package guoan.web.webCustomer;

import guoan.core.dto.RestResponse;
import guoan.service.CustomerService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/webCustomer/customer")
public class CustomerController {
	protected final Logger log = LoggerFactory.getLogger(getClass());

	@Autowired
	private CustomerService customerService;

	/** 保存 */
	@RequestMapping(value = "index", method = RequestMethod.GET)
	public String index() {
		return "webCustomer/customer/index";
	}

	/** 保存 */
	@RequestMapping(value = "save", method = RequestMethod.POST)
	@ResponseBody
	public RestResponse<Boolean> save(String psw) {
		
		customerService.changePSW(psw);
		return RestResponse.ok(true);
	}

}
